package model;

public class Shader {
	public enum Type {
		constant, diffuse, phong, 
		shiny, glass, mirror, ward, 
		ambOcc, uber, janino};
		
	private String name;
	private Color color;
	private Color diff;
	private Integer samples;
	private Texture texture;
	private Spec spec;
	private Double refl;
	private Double eta;
	private Absorbtion absorbtion;
	private Rough rough;
	private Bright bright;
	private Dark dark;
	private Double glossy;
	private Type type;
	
	public Shader(String name, Color color, Color diff, Spec spec, Type type) {
		this.name = name;
		this.color = color;
		this.diff = diff;
		this.spec = spec;
		this.type = type;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Color getColor() {
		return color;
	}
	public void setColor(Color color) {
		this.color = color;
	}
	public Integer getSamples() {
		return samples;
	}
	public void setSamples(Integer samples) {
		this.samples = samples;
	}
	public Texture getTexture() {
		return texture;
	}
	public void setTexture(Texture texture) {
		this.texture = texture;
	}
	public Spec getSpec() {
		return spec;
	}
	public void setSpec(Spec spec) {
		this.spec = spec;
	}
	public Double getRefl() {
		return refl;
	}
	public void setRefl(Double refl) {
		this.refl = refl;
	}
	public Double getEta() {
		return eta;
	}
	public void setEta(Double eta) {
		this.eta = eta;
	}
	public Absorbtion getAbsorbtion() {
		return absorbtion;
	}
	public void setAbsorbtion(Absorbtion absorbtion) {
		this.absorbtion = absorbtion;
	}
	public Rough getRough() {
		return rough;
	}
	public void setRough(Rough rough) {
		this.rough = rough;
	}
	public Bright getBright() {
		return bright;
	}
	public void setBright(Bright bright) {
		this.bright = bright;
	}
	public Dark getDark() {
		return dark;
	}
	public void setDark(Dark dark) {
		this.dark = dark;
	}
	public Double getGlossy() {
		return glossy;
	}
	public void setGlossy(Double glossy) {
		this.glossy = glossy;
	}
	public Color getDiff() {
		return diff;
	}
	public void setDiff(Color diff) {
		this.diff = diff;
	}

	public Type getType() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((absorbtion == null) ? 0 : absorbtion.hashCode());
		result = prime * result + ((bright == null) ? 0 : bright.hashCode());
		result = prime * result + ((color == null) ? 0 : color.hashCode());
		result = prime * result + ((dark == null) ? 0 : dark.hashCode());
		result = prime * result + ((diff == null) ? 0 : diff.hashCode());
		result = prime * result + ((eta == null) ? 0 : eta.hashCode());
		result = prime * result + ((glossy == null) ? 0 : glossy.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((refl == null) ? 0 : refl.hashCode());
		result = prime * result + ((rough == null) ? 0 : rough.hashCode());
		result = prime * result + ((samples == null) ? 0 : samples.hashCode());
		result = prime * result + ((spec == null) ? 0 : spec.hashCode());
		result = prime * result + ((texture == null) ? 0 : texture.hashCode());
		result = prime * result + ((type == null) ? 0 : type.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Shader other = (Shader) obj;
		if (!this.type.equals(other.type)) {
			return false;
		}
		
		if (other.name == null || !this.name.equals(other.name)) {
			return false;
		}
		
		return true;
	}
	
	
}
